<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class Application_Controllers_UsuarioController {

    public function __construct($action) {
        switch ($action) {
//            case "ListAction":
//                $this->_list();
//
//                break;
            case "RegisterAction":
                $this->_registerUser();
                break;
            case "ViewRegisterAction":
                $this->_registerViewRegister();
                break;
        }
    }

    private function createObject() {
        if (!isset(self::$object)) {
            self::$object = Factory::buildObjectClass('Application_Controllers_UsuarioModel');
        }
    }

    private function _registerUser() {
        $model = new Application_Models_UsuarioModel;
//        $model->set_usuario();
        $model->set_password($_REQUEST['password']);
        $model->set_email($_REQUEST['email']);
        $model->set_nick($_REQUEST['user']);
        $model->set_tipo(0);
        $model->set_objectDetalleEmpresa(0);
        $model->_RegisterUserPerson();
    }

    private function _registerViewRegister() {
        $model = new Application_Views_UserView();
        $model->_showRegister();
    }

}

?>
